// 组件样式

// 页面容器
.page-container {
  background: var(--kexilo-bg-color);
  border-radius: var(--kexilo-border-radius-base);
  box-shadow: var(--kexilo-box-shadow-lighter);
  padding: 20px;
  margin: 20px;
  
  @include mobile {
    margin: 10px;
    padding: 15px;
  }
}

// 内容区域
.content-box {
  background: var(--kexilo-bg-color);
  border-radius: var(--kexilo-border-radius-base);
  border: 1px solid var(--kexilo-border-color-lighter);
  padding: 20px;
  
  &.no-padding {
    padding: 0;
  }
  
  &.small-padding {
    padding: 12px;
  }
}

// 搜索表单
.search-form {
  background: var(--kexilo-bg-color);
  border-radius: var(--kexilo-border-radius-base);
  border: 1px solid var(--kexilo-border-color-lighter);
  padding: 16px 20px;
  margin-bottom: 16px;
  
  .el-form-item {
    margin-bottom: 12px;
    
    &:last-child {
      margin-bottom: 0;
    }
  }
  
  .search-actions {
    text-align: right;
    margin-top: 16px;
    
    .el-button {
      margin-left: 8px;
    }
  }
  
  @include mobile {
    padding: 12px;
    
    .search-actions {
      text-align: center;
      
      .el-button {
        margin: 4px;
      }
    }
  }
}

// 表格工具栏
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 0;
  
  .toolbar-left {
    display: flex;
    align-items: center;
    
    .el-button {
      margin-right: 8px;
    }
  }
  
  .toolbar-right {
    display: flex;
    align-items: center;
    
    .toolbar-item {
      margin-left: 8px;
      cursor: pointer;
      color: var(--kexilo-text-color-secondary);
      
      &:hover {
        color: var(--kexilo-primary);
      }
    }
  }
  
  @include mobile {
    flex-direction: column;
    gap: 12px;
    
    .toolbar-left,
    .toolbar-right {
      width: 100%;
      justify-content: center;
    }
  }
}

// 数据表格
.data-table {
  .el-table {
    border: 1px solid var(--kexilo-border-color-lighter);
    
    .table-actions {
      .el-button {
        margin-right: 4px;
        
        &:last-child {
          margin-right: 0;
        }
      }
    }
  }
  
  .table-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    
    @include mobile {
      .el-pagination {
        .el-pagination__sizes,
        .el-pagination__jump {
          display: none;
        }
      }
    }
  }
}

// 状态标签
.status-tag {
  &.status-enabled {
    color: var(--kexilo-success);
    background-color: var(--kexilo-success-light-9);
    border-color: var(--kexilo-success-light-7);
  }
  
  &.status-disabled {
    color: var(--kexilo-danger);
    background-color: var(--kexilo-danger-light-9);
    border-color: var(--kexilo-danger-light-7);
  }
  
  &.status-pending {
    color: var(--kexilo-warning);
    background-color: var(--kexilo-warning-light-9);
    border-color: var(--kexilo-warning-light-7);
  }
}

// 图标按钮
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--kexilo-border-radius-base);
  border: 1px solid var(--kexilo-border-color-light);
  background: var(--kexilo-bg-color);
  color: var(--kexilo-text-color-secondary);
  cursor: pointer;
  transition: var(--kexilo-transition-duration);
  
  &:hover {
    color: var(--kexilo-primary);
    border-color: var(--kexilo-primary);
    background: var(--kexilo-primary-light-9);
  }
  
  &.is-active {
    color: var(--kexilo-primary);
    border-color: var(--kexilo-primary);
    background: var(--kexilo-primary-light-8);
  }
  
  &.is-disabled {
    @include disabled;
  }
}

// 加载容器
.loading-container {
  position: relative;
  
  &.is-loading {
    @include loading;
  }
}

// 空状态
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--kexilo-text-color-secondary);
  
  .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
  }
  
  .empty-text {
    font-size: 14px;
    margin-bottom: 16px;
  }
  
  .empty-actions {
    .el-button {
      margin: 0 4px;
    }
  }
}

// 错误状态
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--kexilo-text-color-secondary);
  
  .error-icon {
    font-size: 64px;
    margin-bottom: 16px;
    color: var(--kexilo-danger);
  }
  
  .error-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--kexilo-text-color-primary);
  }
  
  .error-message {
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
  }
  
  .error-actions {
    .el-button {
      margin: 0 4px;
    }
  }
}

// 面包屑导航
.breadcrumb-container {
  padding: 12px 20px;
  background: var(--kexilo-bg-color);
  border-bottom: 1px solid var(--kexilo-border-color-lighter);
  
  .breadcrumb-inner {
    display: flex;
    align-items: center;
    
    .breadcrumb-title {
      font-size: 16px;
      font-weight: 500;
      color: var(--kexilo-text-color-primary);
      margin-right: 12px;
    }
  }
  
  @include mobile {
    padding: 8px 15px;
    
    .breadcrumb-title {
      font-size: 14px;
    }
  }
}

// 标签页视图
.tags-view {
  height: var(--kexilo-tagsview-height);
  background: var(--kexilo-bg-color);
  border-bottom: 1px solid var(--kexilo-border-color-lighter);
  display: flex;
  align-items: center;
  padding: 0 15px;
  
  .tags-view-wrapper {
    display: flex;
    overflow-x: auto;
    @include scrollbar(4px);
    
    .tags-view-item {
      display: inline-block;
      height: 26px;
      line-height: 26px;
      padding: 0 8px;
      margin-right: 6px;
      background: var(--kexilo-fill-color-light);
      border: 1px solid var(--kexilo-border-color-light);
      border-radius: var(--kexilo-border-radius-small);
      font-size: 12px;
      color: var(--kexilo-text-color-regular);
      cursor: pointer;
      position: relative;
      
      &:hover {
        color: var(--kexilo-primary);
        border-color: var(--kexilo-primary);
      }
      
      &.is-active {
        background: var(--kexilo-primary);
        border-color: var(--kexilo-primary);
        color: white;
      }
      
      .tag-close {
        margin-left: 4px;
        font-size: 10px;
        
        &:hover {
          background: rgba(255, 255, 255, 0.3);
          border-radius: 50%;
        }
      }
    }
  }
}

// 右键菜单
.context-menu {
  position: fixed;
  background: var(--kexilo-bg-color);
  border: 1px solid var(--kexilo-border-color-light);
  border-radius: var(--kexilo-border-radius-base);
  box-shadow: var(--kexilo-box-shadow);
  padding: 4px 0;
  z-index: 3000;
  
  .menu-item {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--kexilo-text-color-regular);
    cursor: pointer;
    
    &:hover {
      background: var(--kexilo-fill-color-light);
      color: var(--kexilo-primary);
    }
    
    &.is-disabled {
      color: var(--kexilo-text-color-disabled);
      cursor: not-allowed;
      
      &:hover {
        background: none;
        color: var(--kexilo-text-color-disabled);
      }
    }
  }
  
  .menu-divider {
    height: 1px;
    background: var(--kexilo-border-color-lighter);
    margin: 4px 0;
  }
}
